﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework;
using InversPong.Services;

namespace InversPong.Screens
{
    class RulesScreen : MenuScreen
    {
        string rule = "Avoid bombs in order to stay alive as long as possible !\n"+
             "First one to lose all his lives lose\n"+
              
             "Modifiers :\n"+ 
             "Snail - Slows down the bat.\n"+
             "Rocket - Speed up the bat.\n"+
             "Viagra pill - Enlarge the bat.\n"+
             "Double arrows - Shrink the bat.\n"+
             "Circling arrows - Swap the bat's directions.\n"+
             "Shield - Invulnerabilty.\n"+
              
             "When hit by a bomb, you get the invulnerabilty bonus \nfor a few seconds.";

        MenuEntry rules;

        public RulesScreen()
            : base("Rules") {
                rules = new MenuEntry(rule);

                MenuEntries.Add(rules);
        }

        public override void LoadContent()
        {
            SimpleMusicPlayer smp = new SimpleMusicPlayer(ScreenManager.Game);
            smp.Load("menu");
            smp.Play();
        }

        public override void UnloadContent()
        {
            SimpleMusicPlayer smp = new SimpleMusicPlayer(ScreenManager.Game);
            smp.Stop();
        }


        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
        }


        public override void Draw(GameTime gameTime)
        {
            GraphicsDevice graphics = ScreenManager.GraphicsDevice;
            SpriteBatch spriteBatch = new SpriteBatch(graphics);
            SpriteFont font = ScreenManager.Font;

            spriteBatch.Begin();
            spriteBatch.DrawString(font, rule, new Vector2(100, 100), Color.White);
            spriteBatch.End();
        }
            
    }
}
